package pkg;

import static org.junit.Assert.*;

import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;

import org.apache.commons.lang3.tuple.Triple;
import org.junit.Test;

import java8stream.Person;

public class Te {
	
	@Test
	public void testName() throws Exception {
		Person person = new Person();
		List<Triple<String, Integer, Integer>> list = person.getData(100);
		list.stream()
		.collect(Collectors.groupingBy(item -> item.getRight()))
		.values()
		.stream()
		.map(item -> item.stream()
						 .sorted((x,y) -> x.getMiddle().compareTo(y.getMiddle()))
						 .collect(Collectors.toList()))
		.collect(Collectors.toList()).forEach(System.out::println);
	}
}
